package com.faxe.letsgroup.ws.boimpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.faxe.letsgroup.ws.bo.GenericBO;
import com.faxe.letsgroup.ws.dao.GenericDAO;
import com.faxe.letsgroup.ws.to.BaseTO;

@Service
public abstract class GenericBOImpl<T extends BaseTO> implements GenericBO<T> {

	GenericDAO<T> dao;
	
	@Autowired
	public void setT(GenericDAO<T> dao) {
		this.dao = dao;
	}
	
	public T find(Integer id) {
		return dao.find(id);
	}

	public void save(T t) {
		dao.save(t);
	}

	public List<T> findAll() {
		return dao.findAll();
	}

	public Integer countAll() {
		return dao.countAll();
	}

	public void delete(T t) {
		dao.delete(t);
	}

      
}